#ifndef WIDGET_HUMAN_H
#define WIDGET_HUMAN_H



#include "units.h"
#include "gui.h"
#include "game.h"
#include <QtGui>



class unit;



class map_square_buy: public QGraphicsPixmapItem
{

public:

	map_square_buy( QGraphicsItem* parent = 0, QGraphicsScene* scene = 0 );

};



class map_bonus_buy: public QGraphicsPixmapItem
{

public:

	map_bonus_buy( bonus* b, QGraphicsItem* parent = 0, QGraphicsScene* scene = 0 );


private:

	bonus* bon;

};



class map_units_square: public QGraphicsPixmapItem
{

public:

	map_units_square( unsigned int id, QGraphicsItem* parent = 0, QGraphicsScene* scene = 0 );


protected:

	void mousePressEvent( QGraphicsSceneMouseEvent* event );

};



class map_unit_buy: public QGraphicsPixmapItem
{

public:
	
	map_unit_buy( unit* un, QGraphicsItem* parent = 0, QGraphicsScene* scene = 0 );

	void setUnitInfo( QLabel* ui )
	{
		uinfo = ui;
	};

	unit* u;
	QLabel* uinfo;

protected:

	void mousePressEvent( QGraphicsSceneMouseEvent* event );

};



class unit_buy: public QWidget
{

	Q_OBJECT

public:

	unit_buy( unit* un, QWidget* parent = 0, Qt::WindowFlags flags = 0 );


private:

	unit* u;


private slots:

	void buy_unit();

};



class human_widget:public QWidget
{

public:

	human_widget( player* pl, QPushButton* nb, QWidget* parent = 0, Qt::WindowFlags flags = 0 );

	void create_map();
	void set_label_money();
	QLabel* print_bought_unit( unit* bu );
	void set_bought_unit( unsigned int x, unsigned int y );
	void set_loaded_objects();
	
	player* current_player;
	QWidget* bought_units_w;
	QGraphicsScene* gs;

	QLabel* money_l;
	QPushButton* next_b;

	array2d< map_square_buy* >* map_array;
	map_unit_buy* bought_unit;

};



#endif